package com.loiot.baqi.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.loiot.baqi.pojo.ZpPositionTypeKeys;

/**
 * 职位类型标签 访问层。
 * 
 * @author  wangzx 
 * @creation 2016-03-26
 */
@Repository("zpPositionTypeKeysDao")
public class ZpPositionTypeKeysDao extends SqlSessionDaoSupport{
    
    /**
     * 添加 职位类型标签
     * 
     * @param p 参数对象
     */
    public ZpPositionTypeKeys addZpPositionTypeKeys(ZpPositionTypeKeys p)throws Exception {
        this.getSqlSession().insert("ZpPositionTypeKeys.addZpPositionTypeKeys", p);
        return p;
    }
    
    /**
     * 修改 职位类型标签
     * 
     * @param p 参数对象
     */
    public void updateZpPositionTypeKeys(ZpPositionTypeKeys p)throws Exception {
        this.getSqlSession().update("ZpPositionTypeKeys.updateZpPositionTypeKeys", p);
    }
    
    /**
     * 修改 职位类型标签
     * 
     * @param p 参数对象
     */
    public void updateZpPositionTypeKeys(HashMap<String,Object> pMap)throws Exception {
        this.getSqlSession().update("ZpPositionTypeKeys.updateZpPositionTypeKeysByMap", pMap);
    }
    
    
    
    /**
     * 删除  职位类型标签
     * 
     * @param id 主键
     */
    public void deleteZpPositionTypeKeys(java.lang.Long id)throws Exception {
        getSqlSession().delete("ZpPositionTypeKeys.deleteZpPositionTypeKeys", id);
    }
    
    /**
     * 删除  职位类型标签
     * 
     * @param id 主键
     */
    public void deleteZpPositionTypeKeys(ZpPositionTypeKeys p)throws Exception {
        getSqlSession().delete("ZpPositionTypeKeys.deleteZpPositionTypeKeys", p);
    }
    
    /**
     * 获得  职位类型标签
     * 
     * @param id 职位类型标签Id
     * 
     * @return 返回与ID匹配的职位类型标签
     */
    public ZpPositionTypeKeys getZpPositionTypeKeysById(java.lang.Long id)throws Exception {
    	HashMap<String, Object> pMap = new HashMap<String, Object>();
    	pMap.put("id", id);
    	return (ZpPositionTypeKeys) getSqlSession().selectOne("ZpPositionTypeKeys.getZpPositionTypeKeysById", pMap);
    }
    
    /**
     * 获得  职位类型标签
     * 
     * @param id 职位类型标签Id
     * 
     * @return 返回与ID匹配的职位类型标签
     */
    public ZpPositionTypeKeys getZpPositionTypeKeysById(java.lang.Long id,Long accountId)throws Exception {
    	HashMap<String, Object> pMap = new HashMap<String, Object>();
    	pMap.put("id", id);
    	pMap.put("inPerson", accountId);
    	return (ZpPositionTypeKeys) getSqlSession().selectOne("ZpPositionTypeKeys.getZpPositionTypeKeysById", pMap);
    }
    
    /**
     * 获得  职位类型标签
     * 
     * @param id 职位类型标签Id
     * 
     */
    public ZpPositionTypeKeys getZpPositionTypeKeys(HashMap<String,Object> pMap)throws Exception {
    	return (ZpPositionTypeKeys) getSqlSession().selectOne("ZpPositionTypeKeys.queryZpPositionTypeKeysList", pMap);
    }
    
    /**
     * 获得  职位类型标签
     * 
     * @param name 职位类型标签名称
     * 
     * @return 返回与NAME匹配的职位类型标签
     */
    public ZpPositionTypeKeys getZpPositionTypeKeysByName(String name)throws Exception {
        return null;
        //return (ZpPositionTypeKeys) getSqlSession().selectOne("ZpPositionTypeKeys.getZpPositionTypeKeysByName", name);
    }
    
    
    
    /**
     * 查询  职位类型标签列表条数
     * 
     * @param name 职位类型标签名称
     * @return 职位类型标签列表条数
     */
    
    public int getZpPositionTypeKeysListCount(HashMap<String,Object> pMap)throws Exception {
        return (Integer) getSqlSession().selectOne("ZpPositionTypeKeys.getZpPositionTypeKeysListCount", pMap);
    }

    /**
     * 查询 职位类型标签列表
     * 
     * @param name 职位类型标签名称
     * @param skipResults 跳过的记录数
     * @param maxResults 最大的记录数
     * @return 职位类型标签列表
     */
    public List<ZpPositionTypeKeys> queryZpPositionTypeKeysList(HashMap<String, Object> pMap, int skipResults, int maxResults)throws Exception {
    	pMap.put("skipResults", skipResults);
    	pMap.put("maxResults", maxResults);
        return getSqlSession().selectList("ZpPositionTypeKeys.queryZpPositionTypeKeysList", pMap);
    }
    
    /**
     * 查询 职位类型标签列表
     * 
     * @param pMap 参数列表
     */
    public List<ZpPositionTypeKeys> queryZpPositionTypeKeysList(HashMap<String, Object> pMap)throws Exception {
        return getSqlSession().selectList("ZpPositionTypeKeys.queryZpPositionTypeKeysList", pMap);
    }
    
    /**
     * 查询 职位类型标签列表
     * 
     * @return 职位类型标签列表
     */
    public List<ZpPositionTypeKeys> queryZpPositionTypeKeysList()throws Exception {
        Map<String, Object> params = new HashMap<String, Object>();
        return getSqlSession().selectList("ZpPositionTypeKeys.queryZpPositionTypeKeysList",params);
    }
    
    /**
     * 查询 职位类型标签列表
     * 
     * @return 职位类型标签列表
     */
    public List<ZpPositionTypeKeys> queryZpPositionTypeKeysList(ZpPositionTypeKeys p )throws Exception {
        return getSqlSession().selectList("ZpPositionTypeKeys.queryZpPositionTypeKeysList",p);
    }
    
    /**
     * 统计 职位类型标签列表
     * 
     * @return 职位类型标签列表
     */
    public List<HashMap<String,Object>> statisticsZpPositionTypeKeysInfo(HashMap<String, Object> pMap )throws Exception {
    	List<HashMap<String,Object>> p = null; 
    	p =(List)getSqlSession().selectList("ZpPositionTypeKeys.statisticsZpPositionTypeKeysInfo",p);
    	return p;
    }
    
    
    
    

}
